package com.gdziarmaga.webshop.login.model;

import java.util.Date;

import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.gdziarmaga.webshop.core.dao.GenericDaoImpl;

@Repository("loginRepo")
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public class LoginDAOImpl extends GenericDaoImpl<Login, Long> implements LoginDAO {

	@Override
	public Login findProductByLogin_date(Date login_date) {
		return getObjectByCriteria(createDetachedCriteria().add(Restrictions.eq(Login.LOGIN_DATE, login_date)));

	}

//	@Override
//	public Login findProductByComputer_ip(String computer_ip) {
//		return getObjectByCriteria(createDetachedCriteria().add(Restrictions.eq(Login.COMPUTER_IP, computer_ip)));
//
//	}

}
